package com.shopping.user.service.impl;

import com.shopping.user.dao.BookMarkMapper;
import com.shopping.user.pojo.BookMark;
import com.shopping.user.service.BookMarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author liaokang
 * @version 1.0
 * @date 2020/6/4 14:12
 */
@Service
public class BookMarkServiceImpl implements BookMarkService {

    @Autowired
    private BookMarkMapper bookMarkMapper;

    @Override
    public List<BookMark> findBookMarkByU_id(int u_id) {
        Example example = new Example(BookMark.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("u_id",u_id);
        return bookMarkMapper.selectByExample(example);
    }

    @Override
    public void delBookMarkByU_id(int s_id) {
        bookMarkMapper.delBookMarkByS_id(s_id);
    }
}
